<?php

namespace app\shop\controller;

use think\Request;
use think\Exception;
use think\Db;
use app\shop\model\Report as ReportModel;

class Report extends \ShopController{

    //汇报列表
    public function index(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->get();
            $data = $ReportModel->search($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function changeState(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->post();
            $data = $ReportModel->changeState($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function removeAccessory(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->get();
            $data = $ReportModel->removeAccessory($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function removeClient(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->get();
            $data = $ReportModel->removeClient($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function removeStaff(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->get();
            $data = $ReportModel->removeStaff($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function add(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->post();
            $data = $ReportModel->add($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function type(Request $request){
        $ReportModel = new ReportModel();
        try {
            $data = $ReportModel->type();
            $this->successTerminate($data);

        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function edit(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->post();
            $data = $ReportModel->edit($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function comment(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->post();
            $data = $ReportModel->comment($params);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function del_comment($id){
        $ReportModel = new ReportModel();
        try {
            $data = $ReportModel->del_comment($id);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function del_report($id){
        $ReportModel = new ReportModel();
        try {
            $data = $ReportModel->del_report($id);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function likes($id){
        $ReportModel = new ReportModel();
        try {
            $data = $ReportModel->likes($id);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function detail($id){
        $ReportModel = new ReportModel();
        try {
            $data = $ReportModel->detail($id);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function report_detail($id){
        $ReportModel = new ReportModel();
        try {
            $data = $ReportModel->report_detail($id);
            $this->successTerminate($data);
        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function other_report(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->get();
            $data = $ReportModel->other_report($params);
            $this->successTerminate($data);

        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function cc_mine_report(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->get();
            $data = $ReportModel->cc_mine_report($params);
            $this->successTerminate($data);

        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

    public function my_report(Request $request){
        $ReportModel = new ReportModel();
        try {
            $params = $request->get();
            $data = $ReportModel->my_report($params);
            $this->successTerminate($data);

        } catch (Exception $e) {
            $this->serverErrorTerminate($e->getMessage());
        }
    }

}